<template>
  <div class="btn">
    <el-button type="default" @click="clickFlush">刷新</el-button>
    <el-button type="primary" @click="clickAdd">新增</el-button>
    <el-button type="danger" @click="clickDelete" :disabled="disDelete"
      >删除</el-button
    >
  </div>
</template>

<script setup lang="ts">
// 声明1个props, 删除按钮是否被禁用
defineProps<{
  // 删除按钮是否禁用
  disDelete?: boolean
}>()

// 声明三个自定义事件
const emits = defineEmits(["clickFlush", "clickAdd", "clickDelete"])

function clickFlush() {
  emits("clickFlush")
}

function clickAdd() {
  emits("clickAdd")
}

function clickDelete() {
  emits("clickDelete")
}
</script>

<style lang="scss" scoped>
.btn {
  margin-bottom: 15px;
}
</style>
